package com.liugui.springbootthreadpool.service;

import com.liugui.springbootthreadpool.annotation.ThreadPoolStatus;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

/**
 * @Author LiuGui
 * @Date 2022年01月15日 11:23:00
 **/
@Slf4j
@Service
public class AsyncService {

    @Async("asyncServiceExecutor")
    @ThreadPoolStatus("测试aop拦截观察线程信息")
    public void executeAsync(){
        log.info("start async");
        try {
            Thread.sleep(2000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        log.info("end async");
    }
}
